#ifndef CPUCONTROLLEDOBJECT_H_
#define CPUCONTROLLEDOBJECT_H_

#include "ControlledObject.h"
#include "Vector2DList.h"
#include "Weapon.h"

class CpuControlledObject : public ControlledObject
{
protected:
	float lastDistance;
	float stagnantTime;
	float giveUpTime;
	float desiredSpeed;
	bool freeWander;
	bool wanderRight;
	int consecutiveFailures;
	bool failedLast;
	List<Vector2D> * currentWaypoint;
	Vector2DList * waypoints;
	
	int panicTextureIndex;
	int normalTextureIndex;
	Object * target;
	Weapon * weapon;
	AnimationManager * normalAnimation;
	AnimationManager * panicAnimation;
	virtual float GetAnimationSpeed();
	virtual Vector2D * GetWallPoseCoordinates();
	virtual bool GetFreeRotate();
	
	public:
	CpuControlledObject(TextureManager * textureManager,
						 Vector2D position, 
						 float mass,
						 Object * target,
						 Weapon * weapon); 
	CpuControlledObject( TextureManager * textureManager,
						 Vector2D position, 
						 float mass,
						 Vector2DList * waypoints,
						 Object * target);
	CpuControlledObject( TextureManager * textureManager,
						 Vector2D position, 
						 float mass,
						 Object * target);
	CpuControlledObject(TextureManager * textureManager,
						 Vector2D position, 
						 float mass,
						 Vector2DList * waypoints,
						 Object * target,
						 Weapon * weapon,
						 Vector2D size,
						 char * textureFile,
						 char * panicFile); 
	virtual ~CpuControlledObject();
	void InitObject();
	virtual void Wander(double elapsedTime);
	virtual bool AttackThink(double elapsedTime);
	virtual void ControlledObjectThinkEntryPoint(double elapsedTime);
	virtual void ControlledObjectDrawEntryPoint();
	virtual void CpuControlledObjectDrawEntryPoint();
	virtual float MoveToward(Vector2D destination);
	virtual void MoveRight();
	virtual void MoveLeft();
	//void Jump();
};
#endif /*CPUCONTROLLEDOBJECT_H_*/
